package com.zhuzi.entity;

import com.zhuzi.jpa.ann.Comment;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.math.BigDecimal;

/**
 * kzz和股票实体
 *
 * @author zhuzi
 * 2022/8/8 18:33
 * @date 2022/12/15
 */
@Data
@Accessors(chain = true)
@Entity
@Table(name = "kzz_base")
//@org.hibernate.annotations.Table(appliesTo = "kzz_base", comment = "可转债和正股代码")
@Comment("可转债和正股代码")
public class KzzAndStockEntity implements Serializable {
    @Id
    @Column(nullable = false, length = 10)
    private String cbCode;
    /**
     * 正股代码
     */
    @Column(length = 10)
    private String stockCode;
    /**
     * 可转债名称
     */
    @Column(length = 20)
    private String cbName;
    @Column(length = 20)
    private String stockName;

    @Column(precision = 8, scale = 2)
    @Comment("价格")
    private BigDecimal price;


    /**
     * 转债余额
     */
    @Comment("转债余额")
    @Column(precision = 8, scale = 2)
    private BigDecimal amount;

    /**
     * 转股溢价率
     */
    @Comment("转股溢价率")
    @Column(precision = 8, scale = 2)
    private BigDecimal premium;

    /**
     * 转股价值
     */
    @Comment("转股价值")
    @Column(precision = 8, scale = 2, columnDefinition = "decimal(5,2)")
    private BigDecimal valuel;

    /**
     * 换手率
     */
    @Column(precision = 8, scale = 2)
    @Comment("换手率")
    private BigDecimal rade;

    @Column(precision = 8, scale = 2)
    @Comment("剩余本息")
    private BigDecimal cbPrice;

    /**
     * 剩余本息-税后
     */
    @Comment("剩余本息-税后")
    @Column(precision = 8, scale = 2)
    private BigDecimal cbPriceTax;

    @Comment("剩余年限")
    @Column(precision = 5, scale = 2)
    private BigDecimal lessYear;

    @Comment("市值")
    @Column(precision = 5)
    private BigDecimal marker;
}
